package chapter1.fundamentals.exercise;

/**
 * 静态方法递归计算lg(N!)的值
 *
 * @author quanlinlin on 2018/11/1 10:10.
 * @version 1.0
 */
public class E_20 {

    public static void main(String[] args) {
        System.out.println(recurLn(3));
    }

    private static double recurLn(int N) {
        if (N == 0 || N == 1) {
            return 0;
        }
        return recurLn(N - 1) + Math.log(N);
    }

}
